#通过调用简单阈值的论文结果
import cv2
import custom
import numpy as np
pic=cv2.imread("pic/ll.png", 0)
custom.showPicture("original",pic)
a1=cv2.pyrDown(pic);
a2=cv2.pyrDown(cv2.pyrDown(pic));
a3=cv2.pyrDown(cv2.pyrDown(cv2.pyrDown(pic)));

pic_1=0.6*0.5*a1
pic_2=0.3*0.6*a2
pic_3=0.1*0.7*a3

pic_2_up=cv2.pyrUp(pic_2)   #第二层向上采样一次
pic_2_up=custom.shapePicture(pic_2_up,pic_1)#判断两个图像是否一样大

pic_3_up=cv2.pyrUp(pic_3)   #第三层向上采样两次
pic_3_up=custom.shapePicture(pic_3_up,pic_2)
pic_3_up=cv2.pyrUp(pic_3_up)
pic_3_up=custom.shapePicture(pic_3_up,pic_1)#判断两个图像是否一样大

pic_total=((pic_1+pic_2_up+pic_3_up)*4).astype(np.uint8)#改变图像存储类型取整
custom.showPicture("total1",pic_total)
cv2.waitKey(0)